package com.xm.xm.undercover.utils

import android.content.Context
import android.util.Log
import android.view.LayoutInflater
import com.google.gson.Gson
import com.xm.xm.undercover.bean.GetMessage
import com.xm.xm.undercover.ui.RoomActivity

class ReadMessage {
    val roomAct = RoomActivity()

    fun doRead(context:Context,message:String){
        val gson = Gson()
        val info =  gson.fromJson(message,GetMessage::class.java)
        when (info.id){
            // 1 3 4 5 7  8 9 10
//            "9" -> updateUserUI(context,info.mes)
        }
    }

//    private fun updateUserUI(context:Context,mes:String) {
//        val userInfo = mes.split(";")
//        for (str in userInfo){
//            Log.d("testActivity",str)
//            val strs = str.split(",")
//            val userIndex = strs[0].toInt()-1
//            val userName = strs[1]
////            if (roomAct==null){
////                Log.d("testActivity","false  null")
////            }
//            roomAct.showUser(userIndex,userName)
//        }
//    }


}